home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
ANC_UTULITYS_16.adf
/
arclist
/
asm2.arc
/
ten1.S
next >
Wrap
Text File
|
1988-09-21
|
9KB
|
386 lines
beg: ; As usual...
movem.l d0/d1/d2/d3/d4/d5/d6/d7/a0/a1/a2/a3/a4/a5/a6,-(a7)
move.l a7,InitialSP ; Just to be on the safe side
bsr SwitchOSout ; Switch out Operating System
bsr Initchips ; Setup Custom chip pointers
bsr Initint ; Setup Interrupts.
bsr InitOther ; Init the other stuff
bsr Wait ; Handle input stuff
bsr Resetint ; Reset interrupts
bsr Resetchips ; Reset custom chips
bsr SwitchOSin ; Switch in Operating System.
move.l InitialSP,a7 ; Restore Stack Frame Pointer
movem.l (a7)+,a0/a1/a2/a3/a4/a5/a6/d0/d1/d2/d3/d4/d5/d6/d7
rts
InitialSP:dc.l 0 ; Hold initial SP
SwitchOSout: ; Switch out disturbing stuff.
move.l $4,a6 ; System Base
lea gfxlib,a1
clr.l d0
jsr -552(a6) ; _LVOOpenLibrary
move.l d0,gfxbase ; Save Graphics_lib base
jsr -$84(a6) ; _LVOForbid
jsr -$96(a6) ; _LVOSuperState
move.l d0,systack ; System stack
rts
systack:dc.l 0
gfxlib:dc "graphics.library",0,0
gfxbase:dc.l 0
Initchips: ; Initialize custom chips
move.w $dff01c,intesave
move.w $dff01e,intrsave
move.w $dff002,dmasave
move.w $dff010,adksave
move.w #%0111111111111111,$dff096 ; DMACONW
move.w #%1000001111100000,$dff096 ; Disable disk access.
move.w #%0111111111111111,$dff09a ; INTENA
move.w #%1100000000110100,$dff09a ; Enable desired IRQ's
move.l #copl,$dff080
rts
intesave:dc.w 0
intrsave:dc.w 0
dmasave:dc.w 0
adksave:dc.w 0
InitInt: ; Initialize interrupts
move.l $6c,level3save ; Save level 3 vector
move.l $6c,af3+2
move.l $68,level2save ; Save level 2 vector
move.l $68,af2+2
move.l #level2irq,$68 ; Set new interrupt vector 2
move.l #level3irq,$6c ; Set new interrupt vector 3
rts
level2save:dc.l 0
level3save:dc.l 0
ResetInt: ; Reset Interrupts
move.l level3save,$6c ; Restore level 3 vector
move.l level2save,$68 ; Restore level 2 vector
rts
Resetchips: ; Reset custom chips
move.w intesave,d7
bset #$f,d7
move.w d7,$dff09a ; Reset Interrupts
move.w intrsave,d7
bset #$f,d7
move.w d7,$dff09c ; Reset interrupt request
move.w dmasave,d7
bset #$f,d7
move.w d7,$dff096 ; Reset DMAConw
move.w adksave,d7
bset #$f,d7
move.w d7,$dff09e ; Reset ADK
move.l gfxbase,a0
move.l $26(a0),$dff080
rts
SwitchOSIn: ; Allow OS to operate again.
move.l 4,a6 ; System Base
jsr -$8a(a6) ; _LVOPermit
move.l systack,d0 ; Systemstack
jsr -$9c(a6) ; _LVOUserState
rts
level2irq:
af2:jmp 0
level3irq:
movem.l d0/d1/d2/d3/d4/d5/d6/d7/a0/a1/a2/a3/a4/a5/a6,-(a7)
;move.w #$000f,$dff180
movem.l (a7)+,d0/d1/d2/d3/d4/d5/d6/d7/a0/a1/a2/a3/a4/a5/a6
af3:jmp 0
rotdly:dc.w 250
rotdirection:dc.w 0
rotate:dc.w 0
dorotation:
tst.w rotate
bne.s rotatin
subq.w #1,rotdly
bne.s norot
move.w #150,rotate
rotatin:
subq.w #1,rotate
beq.s norot3
tst.w rotdirection
bne.s other
lea dire,a0
moveq #99,d6
slp:
move.w (a0),d0
addq.w #2,d0
cmpi.w #720,d0
blt.s nomore
subi.w #720,d0
nomore:
move.w d0,(a0)+
dbf d6,slp
bra.s norot2
other:
lea dire,a0
moveq #99,d6
slp2:
move.w (a0),d0
subq.w #2,d0
cmpi.w #0,d0
bge.s nomore2
addi.w #720,d0
nomore2:
move.w d0,(a0)+
dbf d6,slp2
bra.s norot2
norot3:
eor.w #$ffff,rotdirection
move.w #250,rotdly
norot2:
norot:
rts
initother:
lea $60000,a0
move.w #$1600,d0
clp:
clr.l (a0)+
dbf d0,clp
rts
Wait: ; Wait.
bsr dostars
bsr dorotation
btst #6,$bfe001
bne.s wait
rts
dostars:
moveq #0,d3
moveq #99,d2
lea $60000,a0 ; Bpl 1
lea $62c00,a1 ; Bpl 2
lea sine,a6 ; Sine table
lea posx,a5 ; X pos table
lea posy,a4 ; Y pos table
lea dire,a3 ; Direction table
thelot:
moveq #0,d0
move.w (a5),d0 ; Xpos * 100
move.w (a4),d1 ; Ypos * 100
move.w (a3)+,d7 ; Direction (angle * 2)
move.w d7,d6
add.w #180,d6 ; Y direction
cmpi.w #720,d6
blt.s notnow
subi.w #720,d6 ; cos(360)=cos(0)
notnow:
movem.l d0/d1/d3,-(a7)
divu #100,d0
divu #100,d1
mulu #44,d1
move.w d0,d3
asr.w #3,d3
not.b d0 ; DELETE OLD STAR
andi.w #7,d0
add.l d3,d1
bclr d0,0(a0,d1)
bclr d0,0(a1,d1)
lea $2c00(a1),a1
bclr d0,0(a1,d1)
lea -$2c00(a1),a1
movem.l (a7)+,d0/d1/d3
move.l d7,-(a7)
move.w (a6,d7.w),d5 ; Get sine value
move.w (a6,d6.w),d4 ; Get cosine value
move.w 198(a3),d7
divu #25,d7
mulu d7,d4
mulu d7,d5
divu #100,d4
divu #100,d5
move.l (a7)+,d7
add.w d5,d0 ; Xpos
add.w d4,d1 ; Ypos
move.w d0,(a5)+ ; Xpos save
move.w d1,(a4)+ ; YPos save
divu #100,d0 ; Xpos = Xpos/100 = Xpos
divu #100,d1 ; Ypos = Ypos/100 = Ypos
cmpi.w #352,d0
bge.s res
cmpi.w #0,d0
blt.s res
cmpi.w #256,d1
bge.s res
cmpi.w #0,d1
bge.s nores
res:
move.w #176,d0
move.w #17600,-2(a5) ; Save the pos'n
move.w #127,d1
move.w #12700,-2(a4)
clr.w 198(a3) ; Clear nummoves
nores:
addq.w #1,198(a3)
; SETDOT
move.l d7,-(a7)
mulu #44,d1
move.w d0,d3
asr.w #3,d3 ; Divide by 8
add.l d3,d1
not.b d0
andi.w #7,d0
move.w 198(a3),d7
divu #32,d7
addq.b #1,d7
cmpi.b #7,d7
ble.s nofix
moveq #7,d7
nofix:
asr.b #1,d7
bcc.s nopl1
bset d0,0(a0,d1) ; Set point
nopl1:
asr.b #1,d7
bcc.s nopl2
bset d0,0(a1,d1)
nopl2:
asr.b #1,d7
bcc.s nopl3
lea $2c00(a1),a1
bset d0,(a1,d1)
lea -$2c00(a1),a1
nopl3:
move.l (a7)+,d7
dbf d2,thelot
rts
posx:
dc.w 17600,17600,27600,07600,17600,12600,19600,29600,07600,01600
dc.w 17600
dc.w 27600,17600,17600,17600,17600,17600,17600,17600,17600,17600
dc.w 17600
dc.w 17600,15600,17600,15400,24300,30600,17600,11700,17600,17600
dc.w 17600
dc.w 17600,07600,03600,14600,12100,12600,13600,19600,11600,10600
dc.w 17600
dc.w 27100,17600,17600,26600,24600,29100,17600,31600,17600,17600
dc.w 11600
dc.w 19600,17600,22600,17600,27600,17600,17600,17600,17600,17600
dc.w 24600
dc.w 09600,17600,22600,17600,27600,17600,17600,17600,17600,17600
dc.w 24600
dc.w 09600,27600,22600,17600,27600,17600,17600,17600,17600,17600
dc.w 24600
dc.w 19600,17600,22600,17600,27600,17600,17600,17600,17600,17600
dc.w 24600
dc.w 19600,17600,22600,17600,27600,17600,17600,17600,17600,17600
dc.w 24600
posy:
dc.w 12700,12700,12700,12700,12700,12700,12700,12700,12700,12700
dc.w 12700
dc.w 12700,12700,12700,12700,12700,12700,12700,12700,12700,12700
dc.w 12700
dc.w 12700,02700,13700,14700,15700,16700,17700,18700,19700,12700
dc.w 12700
dc.w 02700,10700,19700,12700,12700,12700,12700,12700,12700,12700
dc.w 12700
dc.w 22700,12700,12700,12700,12700,12700,12700,12700,12700,12700
dc.w 14700
dc.w 19700,12700,16700,12700,12700,12700,12700,12700,12700,12700
dc.w 18700
dc.w 10700,16700,12700,12700,12700,12700,12700,12700,12700,12700
dc.w 12700
dc.w 18700,12700,12700,12700,12700,12700,12700,12700,12700,12700
dc.w 12700
dc.w 16700,17700,12700,12700,12700,12700,12700,12700,12700,12700
dc.w 12700
dc.w 14700,22700,19700,21700,20700,12700,12700,12700,12700,12700
dc.w 12700
dire:
dc.w 000,090,180,270,360,450,540,630,044,134
dc.w 006,096,186,276,366,456,546,636,050,140
dc.w 012,102,192,282,372,462,552,642,056,146
dc.w 018,108,198,288,378,468,558,648,062,152
dc.w 024,114,204,294,384,474,564,654,068,156
dc.w 030,120,210,300,390,480,570,660,074,162
dc.w 124,114,204,306,396,474,564,654,068,156
dc.w 130,120,210,312,402,480,570,660,074,162
dc.w 124,114,204,318,408,474,564,654,068,156
dc.w 130,120,210,324,414,180,470,260,474,262
nummoves:
blk.w 100,0
copl:
dc.w $0100,$3200
dc.w $00e0,$0006,$00e2,$0000
dc.w $00e4,$0006,$00e6,$2c00
dc.w $00e8,$0006,$00ea,$5800
dc.w $0102,$0000,$0104,$0030,$008e,$2480
dc.w $0090,$24e0,$0092,$0030,$0094,$00d8
dc.w $010a,$0000,$0108,$0000,$0120,$0000
dc.w $0122,$0000
dc.w $0182,$0666,$0184,$0888,$0186,$0aaa,$0188,$0bbb
dc.w $018a,$0ccc,$018c,$0ddd,$018e,$0eee
dc.w $0124,$0000,$0126,$0000,$0128,$0000,$012a,$0000
dc.w $012c,$0000,$012e,$0000,$0130,$0000,$0132,$0000
dc.w $0134,$0000,$0136,$0000,$0138,$0000,$013a,$0000
dc.w $013c,$0000,$013e,$0000
dc.w $0180,$0000,$0186,$0bbb
dc.w $ffff,$fffe
sine:
dc.w 0, 2, 6, 10, 12, 16,20, 24, 26, 30, 34, 38
dc.w 40, 44, 48, 50, 54, 58,60, 64, 68, 70, 74, 78
dc.w 80, 84, 86, 90, 92, 96,100, 102, 104, 108, 110, 114
dc.w 116, 120, 122, 124, 128, 130, 132, 136, 138, 140, 142, 146
dc.w 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170
dc.w 172, 174, 176, 178, 178, 180, 182, 184, 184, 186, 186, 188
dc.w 190, 190, 192, 192, 194, 194, 194, 196, 196, 196, 198, 198
dc.w 198, 198, 198, 198, 198, 198, 200, 198, 198, 198, 198, 198
dc.w 198, 198, 198, 196, 196, 196, 194, 194, 194, 192, 192, 190
dc.w 190, 188, 186, 186, 184, 184, 182, 180, 178, 178, 176, 174
dc.w 172, 170, 168, 166, 164, 162, 160, 158, 156, 154, 152, 150
dc.w 148, 146, 142, 140, 138, 136, 132, 130, 128, 124, 122, 120
dc.w 116, 114, 110, 108, 104, 102, 98, 96, 92, 90, 86, 84
dc.w 80, 78, 74, 70, 68, 64, 60, 58, 54, 50, 48, 44
dc.w 40, 38, 34, 30, 26, 24, 20, 16, 12, 10, 6, 2
dc.w -2,-4,-8,-12,-14,-18,-22,-26,-28,-32,-36,-40
dc.w -42,-46,-50,-52,-56,-60,-62,-66,-70,-72,-76,-80
dc.w -82,-86,-88,-92,-94,-98,-102,-104,-106,-110,-112,-116
dc.w -118,-122,-124,-126,-130,-132,-134,-138,-140,-142,-144,-148
dc.w -150,-152,-154,-156,-158,-160,-162,-164,-166,-168,-170,-172
dc.w -174,-176,-178,-180,-180,-182,-184,-186,-186,-188,-188,-190
dc.w -192,-192,-194,-194,-196,-196,-196,-198,-198,-198,-200,-200
dc.w -200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200,-200
dc.w -200,-200,-200,-198,-198,-198,-196,-196,-196,-194,-194,-192
dc.w -192,-190,-188,-188,-186,-186,-184,-182,-180,-180,-178,-176
dc.w -174,-172,-170,-168,-166,-164,-162,-160,-158,-156,-154,-152
dc.w -150,-148,-144,-142,-140,-138,-134,-132,-130,-126,-124,-122
dc.w -118,-116,-112,-110,-106,-104,-100,-98,-94,-92,-88,-86
dc.w -82,-80,-76,-72,-70,-66,-62,-60,-56,-52,-50,-46
dc.w -42,-40,-36,-32,-28,-26,-22,-18,-14,-12,-8,-4
end: